package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementPortMtnEvthSubMapper;
import com.ruoyi.net.domain.ElementPortMtnEvthSub;
import com.ruoyi.net.service.IElementPortMtnEvthSubService;

/**
 * 网元-接口-mtnevth子接口Service业务层处理
 * 
 * @author tony
 * @date 2024-12-24
 */
@Service
public class ElementPortMtnEvthSubServiceImpl implements IElementPortMtnEvthSubService 
{
    @Autowired
    private ElementPortMtnEvthSubMapper elementPortMtnEvthSubMapper;

    /**
     * 查询网元-接口-mtnevth子接口
     * 
     * @param id 网元-接口-mtnevth子接口主键
     * @return 网元-接口-mtnevth子接口
     */
    @Override
    public ElementPortMtnEvthSub selectElementPortMtnEvthSubById(String id)
    {
        return elementPortMtnEvthSubMapper.selectElementPortMtnEvthSubById(id);
    }

    /**
     * 查询网元-接口-mtnevth子接口列表
     * 
     * @param elementPortMtnEvthSub 网元-接口-mtnevth子接口
     * @return 网元-接口-mtnevth子接口
     */
    @Override
    public List<ElementPortMtnEvthSub> selectElementPortMtnEvthSubList(ElementPortMtnEvthSub elementPortMtnEvthSub)
    {
        return elementPortMtnEvthSubMapper.selectElementPortMtnEvthSubList(elementPortMtnEvthSub);
    }

    /**
     * 新增网元-接口-mtnevth子接口
     * 
     * @param elementPortMtnEvthSub 网元-接口-mtnevth子接口
     * @return 结果
     */
    @Override
    public int insertElementPortMtnEvthSub(ElementPortMtnEvthSub elementPortMtnEvthSub)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementPortMtnEvthSub.getId())) {
            elementPortMtnEvthSub.setId(uuid);
        }
        elementPortMtnEvthSub.setCreateBy(SecurityUtils.getUsername());
        elementPortMtnEvthSub.setCreateTime(DateUtils.getNowDate());
        elementPortMtnEvthSub.setUpdateBy(SecurityUtils.getUsername());
        elementPortMtnEvthSub.setUpdateTime(DateUtils.getNowDate());
        return elementPortMtnEvthSubMapper.insertElementPortMtnEvthSub(elementPortMtnEvthSub);
    }

    /**
     * 修改网元-接口-mtnevth子接口
     * 
     * @param elementPortMtnEvthSub 网元-接口-mtnevth子接口
     * @return 结果
     */
    @Override
    public int updateElementPortMtnEvthSub(ElementPortMtnEvthSub elementPortMtnEvthSub)
    {
        elementPortMtnEvthSub.setUpdateBy(SecurityUtils.getUsername());
        elementPortMtnEvthSub.setUpdateTime(DateUtils.getNowDate());
        return elementPortMtnEvthSubMapper.updateElementPortMtnEvthSub(elementPortMtnEvthSub);
    }

    /**
     * 批量删除网元-接口-mtnevth子接口
     * 
     * @param ids 需要删除的网元-接口-mtnevth子接口主键
     * @return 结果
     */
    @Override
    public int deleteElementPortMtnEvthSubByIds(String[] ids)
    {
        return elementPortMtnEvthSubMapper.deleteElementPortMtnEvthSubByIds(ids);
    }

    /**
     * 删除网元-接口-mtnevth子接口信息
     * 
     * @param id 网元-接口-mtnevth子接口主键
     * @return 结果
     */
    @Override
    public int deleteElementPortMtnEvthSubById(String id)
    {
        return elementPortMtnEvthSubMapper.deleteElementPortMtnEvthSubById(id);
    }
}
